package com.bank.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author callumEm
 * @version 1.0
 * @create 2023/4/15 10:55
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ChatRecord {
    @TableId(type = IdType.AUTO)
    Long id;
    Long fromId;
    Long toId;
    int typeEnum;
    String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // 返回给前端的时候进行格式化
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 前端转递过来的时候进行格式化
    @TableField(fill = FieldFill.INSERT)
    Date createdTime;
}
